---@class Bool 布尔值
---@class Int8 整型
---@class Int16 整型
---@class Int32 整型
---@class Int64 整型
---@class UInt8 无符号整型
---@class UInt16 无符号整型
---@class UInt32 无符号整型
---@class UInt64 无符号整型
---@class Fixed 定点数
---@class FVector2 定点数Vector2
---@class FVector3 定点数Vector3
---@class FPoint 点
---@class Float 浮点数
---@class Vector2 浮点数Vector2
---@class Vector3 Vector3
---@class Point 点
---@class RoleID 玩家ID
---@class RoleRelation 玩家关系
---@class CampID 阵营ID
---@class UnitID 单位ID
---@class HighLightUnitID 主控单位ID
---@class ProjectileID 投射物ID
---@class AbilitySeq 技能序号
---@class UnitKey 单位编号
---@class UnitType 单位类型
---@class AbilityKey 技能编号
---@class WeatherType 天气类型
---@class ModifierKey 效果编号
---@class SortType 排序类型
---@class ProjectileKey 投射物编号
---@class AbilityCastType 技能释放类型
---@class AbilityStrAttr 技能字符串类型属性
---@class SfxVisibleType 可见性规则
---@class LinkSfxPointType 起点或终点
---@class MovementObstacleProcessType 碰撞处理
---@class AttackTargetHitType 攻击目标类别
---@class ItemID 物品ID
---@class ItemKey 物品编号
---@class RandomPool 随机池
---@class SceneNode 场景UI
---@class TechKey 科技编号
---@class UIAnimKey UI动画ID
---@class RoleStatus 玩家状态
---@class RoleType 玩家控制者类型
---@class AudioKey 音效编号
---@class SfxKey 特效编号
---@class LinkSfxKey 链接特效编号
---@class ModelKey 模型编号
---@class TriggerID 触发器ID
---@class DynamicTriggerInstance 动态触发器实例
---@class AreaID 区域ID
---@class CamlineID 镜头timelineID
---@class SlotType 背包槽位类型
---@class Str 字符串
---@class RoleResKey 资源类型
---@class StoreKey 平台道具类型
---@class TabName 商店页签
---@class TabIdx 商店页签ID
---@class Texture 图片
---@class MiniMapColorType 小地图颜色显示模式
---@class UnitBehavior 单位行为
---@class Shape 形状
---@class ExprList EAExpr列表
---@class UIntList UInt列表
---@class IntList Int列表
---@class Iterator 迭代器
---@class Int32Iterator 整数迭代器
---@class KVBase KVBase
---@class Actor Actor
---@class UIPreset UIPreset
---@class Unit 单位
---@class UnitGroup 单位组
---@class UnitKeyPool 单位编号池
---@class Camera 镜头配置
---@class RoleGroup 玩家组
---@class Item 物品对象
---@class SoundEntity 声音对象
---@class ItemGroup 物品组
---@class Destructible 可破坏物对象
---@class DestructibleID 可破坏物ID
---@class DestructibleKey 可破坏物编号
---@class Role 玩家
---@class Camp 阵营对象
---@class Area 区域
---@class RecArea 矩形区域
---@class CirArea 圆形区域
---@class PolyArea 多边形区域
---@class RoadGroup 路径组
---@class LightID 光源ID
---@class Light 光源
---@class PointLight 点光源
---@class SpotLight 方向光源
---@class Fog 局部雾
---@class FogID 雾ID
---@class Ability 技能对象
---@class ModifierEntity 效果对象
---@class ModifierEffectType 效果类型
---@class ModifierType 魔法效果类别
---@class ModifierStyle 效果类别
---@class ProjectileEntity 投掷物对象
---@class ProjectileGroup 投射物组
---@class ActorList Actor列表
---@class UnitList Actor列表
---@class UnitModel 单位展示模型
---@class RoleRes 玩家资源类型
---@class CameraPreset 镜头预设
---@class Road 路径
---@class Model 模型
---@class Sfx 特效
---@class LinkSfx 链接特效
---@class UnitCommand 单位命令
---@class UnitCommandType 单位命令类型
---@class Timer 计时器
---@class Formula 公式
---@class KeyboardKey 键盘按键
---@class FuncKeyboardKey 键盘辅助按键
---@class MouseKey 鼠标按键
---@class MouseWheel 鼠标滚轮
---@class GameMode 游戏模式
---@class StartMode 游戏环境
---@class EditableGameFunc 可修改基础操作
---@class AllGameFunc 所有基础操作
---@class NormalKey 局内功能按键
---@class RecordKey 局内功能键
---@class CameraRotate 相机角度模式
---@class LanguageType 语言环境
---@class HitPointKey 埋点数据key
---@class CurvedPath 曲线运动器路径
---@class Table 表
---@class PostEffect 画风
---@class UIPrefabIns 界面预制体实例
---@class SkillPointerType 技能指示器类型
---@class AbilityID 技能ID


---@class color color
local color = {
    r = 255,
    g = 255,
    b = 255,
    a = 255,
}
---@class vec3 vec3
local vec3 = {
    x = 0,
    y = 0,
    z = 0,
}
---@class vec2 vec2
local vec2 = {
    x = 0,
    y = 0,
}
---@class size vec2
local size = {
    w = 0,
    h = 0,
}
---@class bar bar
---@field progress Float 当前值
---@field time Float 渐变时间
local bar = {
    progress = 0,
    time = 0
}

---@generic T
---@alias UI_EVENT fun(data:any,player:GT.player,ui:T):void
---@alias ui_event_create fun(u:any):void
---@alias ui_event_del fun(u:any):void


---@class kv_class 自定义键
---@field K any 键
---@field V any 值
---@field call kv_call 数值变化回调


---@class ToString
ToString = {
    [100000] = function(value)
        return global_api.float_to_str(value)
    end,
    [100001] = function(value)
        return global_api.bool_to_str(value)
    end,
    [100002] = function(value)
        return global_api.int64_to_str(value)
    end,
    [100003] = function(value)
        return value
    end,
    [100004] = function(value)
        return global_api.vector3_to_str(value.base())
    end,
    [100210] = function(value)
        return global_api.unit_command_type_to_str(value)
    end,
    [100219] = function(value)
        return global_api.ability_cast_type_to_str(value)
    end,
    [100191] = function(value)
        return game_api.link_sfx_key_to_str(value)
    end,
    [100150] = function(value)
        return global_api.poly_area_to_str(value)
    end,
    [100203] = function(value)
        return global_api.projectile_group_to_str(value)
    end,
    [1000204] = function(value)
        return global_api.role_relation_to_str(value)
    end,
    [100038] = function(value)
        return global_api.unit_key_pool_to_str(value)
    end,
    [100010] = function(value)
        return global_api.unit_type_to_str(value)
    end,
    [100181] = function(value)
        return global_api.timer_to_str(value)
    end,
    [100006] = function(value)
        return global_api.unit_to_str(value.base())
    end,
    [100026] = function(value)
        return global_api.unit_group_to_str(value)
    end,
    [100116] = function(value)
        return game_api.unit_key_to_str(value)
    end,
    [100042] = function(value)
        return game_api.unit_attr_to_str(value)
    end,
    [100031] = function(value)
        return global_api.item_to_str(value.base())
    end,
    [100171] = function(value)
        return global_api.item_group_to_str(value)
    end,
    [100032] = function(value)
        return game_api.item_key_to_str(value)
    end,
    [100025] = function(value)
        return global_api.role_to_str(value and value.base() or nil)
    end,
    [100027] = function(value)
        return global_api.role_group_to_str(value)
    end,
    [100037] = function(value)
        return game_api.role_res_to_str(value)
    end,
    [100180] = function(value)
        return global_api.role_status_to_str(value)
    end,
    [100179] = function(value)
        return global_api.role_type_to_str(value)
    end,
    [100014] = function(value)
        return global_api.ability_to_str(value.base())
    end,
    [100039] = function(value)
        return game_api.ability_key_to_str(value)
    end,
    [100182] = function(value)
        return global_api.ability_type_to_str(value)
    end,
    [100009] = function(value)
        return global_api.rect_area_to_str(value)
    end,
    [100023] = function(value)
        return global_api.circle_area_to_str(value)
    end,
    [100024] = function(value)
        return global_api.road_to_str(value)
    end,
    [100205] = function(value)
        return global_api.dest_to_str(value.base())
    end,
    [100207] = function(value)
        return game_api.dest_key_to_str(value)
    end,
    [100077] = function(value)
        return global_api.project_to_str(value.base())
    end,
    [100062] = function(value)
        return game_api.project_key_to_str(value)
    end,
    [100148] = function(value)
        return game_api.sfx_to_str(value)
    end,
    [100066] = function(value)
        return game_api.particle_sfx_key_to_str(value)
    end,
    [100172] = function(value)
        return game_api.tech_key_to_str(value)
    end,
    [100202] = function(value)
        return game_api.link_sfx_to_str(value)
    end,
    [100147] = function(value)
        return game_api.model_entity_to_str(value)
    end,
    [100122] = function(value)
        return game_api.model_key_to_str(value)
    end,
    [100076] = function(value)
        return global_api.modifier_entity_to_str(value.base())
    end,
    [100186] = function(value)
        return global_api.modifier_type_to_str(value)
    end,
    [100174] = function(value)
        return global_api.modifier_effect_type_to_str(value)
    end,
    [100046] = function(value)
        return game_api.modifier_key_to_str(value)
    end,
    [100020] = function(value)
        return global_api.camp_to_str(value)
    end,
    [100201] = function(value)
        return global_api.random_pool_to_str(value)
    end,
    [200220] = function(value)
        return global_api.keyboard_key_to_str(value)
    end,
    [200221] = function(value)
        return global_api.mouse_key_to_str(value)
    end,
    [100134] = function(value)
        return game_api.store_key_to_str(value)
    end,
    [100178] = function(value)
        return global_api.trigger_to_str(value)
    end,
    [100073] = function(value)
        return game_api.camera_to_str(value)
    end,
    [100011] = function(value)
        return global_api.table_to_str(value)
    end,
    [100064] = function(value)
        return global_api.damage_type_to_str(value)
    end,
    [100300] = function(value)
        return global_api.unit_attr_type_to_str(value)
    end,
    [100214] = function(value)
        return game_api.sound_entity_to_str(value)
    end,
    [100070] = function(value)
        return game_api.ui_comp_to_str(value)
    end,
    [100084] = function(value)
        return game_api.audio_key_to_str(value)
    end,
    [200222] = function(value)
        return global_api.mouse_wheel_to_str(value)
    end,
    [100263] = function(value)
        return global_api.mover_entity_to_str(value)
    end,
}
---@class AbilityType 技能类型
AbilityType = {
    ['Hide'] = 0, ['Normal'] = 1, ['Common'] = 2, ['Hero'] = 3
}

---@class AbilityCastType 技能类型
AbilityCastType = {
    ['Normal'] = 1,
    ['Active'] = 2,
    ['Passive'] = 3,
    ['建造'] = 4,
    ['Gather'] = 5,
}

AbilityCastTypeId = {
    'Normal', 'Active', 'Passive', 'Build', 'Gather'
}

KvType = {
    ['real'] = 'float',
    ['str'] = 'string',
    ['int'] = 'integer',
    ['string'] = 'string',
    ['integer'] = 'integer',
    ['bool'] = 'boolean',
    ['boolean'] = 'boolean',
    ['ui'] = 'ui_comp',
    ['unit'] = 'unit_entity',
    ['unitName'] = 'unit_name',
    ['unitType'] = 'unit_name',
    ['unitGroup'] = 'unit_group',
    ['item'] = 'item_entity',
    ['itemName'] = 'item_name',
    ['itemType'] = 'item_name',
    ['abilityType'] = 'ability_type',
    ['abilityCast'] = 'ability_cast_type',
    ['abilityName'] = 'ability_name',
    ['model'] = 'model',
    ['tech'] = 'tech_key',
    ['buff'] = 'modifier',
}

---data的枚举类,包含所有data字段
DATA_ENUM = {
    ['name'] = "__name",
    ['area'] = "__area",
    ['unit'] = "__unit",
    ['unit2'] = "__unit2",
    ['other_unit'] = "__other_unit",
    ['src_unit'] = "__source_unit",
    ['target_unit'] = "__target_unit",
    ['click_unit'] = "__click_unit",
    ['owner_unit'] = "__owner_unit",
    ['unit_for_dest'] = "__unit_for_dest",
    ['unit_id'] = "__unit_id",
    ['unit_key'] = "unit_key",
    ['build_unit_id'] = "__build_unit_id",
    ['high_light_unit_id'] = "__high_light_unit_id",
    ['unit_group_id_list'] = "__unit_group_id_list",
    ['unit_stuff_id'] = "__unit_stuff_id",
    ['shop_unit_id'] = "__shop_unit_id",
    ['from_unit_id'] = "__from_unit_id",
    ['mover_unit_id'] = "__mover_unit_id",
    ['collide_unit_id'] = "__collide_unit_id",
    ['trigger_id'] = "__trigger_id",
    ['area_id'] = "__area_id",
    ['role_id'] = "__role_id",
    ['src_role_id'] = "__src_role_id",
    ['dst_role_id'] = "__dst_role_id",
    ['role_res_key'] = "__role_res_key",
    ['unit_tag'] = "__unit_tag",
    ['item'] = "__item",
    ['target_item'] = "__target_item",
    ['item_id'] = "__item_id",
    ['item_no'] = "__item_no",
    ['item_stuff_id'] = "__item_stuff_id",
    ['item_unit_id'] = "__item_unit_id",
    ['tab_idx'] = "__tab_idx",
    ['compose_id'] = "__compose_id",
    ['owner'] = "__owner",
    ['relation'] = "__relation",
    ['container'] = "__container",
    ['store_key'] = "__store_key",
    ['shop_key'] = "__shop_key",
    ['shop_item_iter'] = "shop_item_iter",
    ['modifier'] = "__modifier",
    ['modifier_id'] = "__modifier_id",
    ['old_modifier'] = "__old_modifier",
    ['new_modifier'] = "__new_modifier",
    ['modifier_iter'] = "modifier_iter",
    ['destructible'] = "__destructible",
    ['destructible_id'] = "__destructible_id",
    ['destructible_iter'] = "destructible_iter",
    ['unit_id_of_dest_killer'] = "__unit_id_of_dest_killer",
    ['unit_id_in_dest_event'] = "__unit_id_in_dest_event",
    ['res_chg_cnt_in_dest_event'] = "__res_chg_cnt_in_dest_event",
    ['ability_in_dest_event'] = "__ability_in_dest_event",
    ['item_id_in_dest_event'] = "__item_id_in_dest_event",
    ['role_res_cnt_in_event'] = "__role_res_cnt_in_event",
    ['unit_id_of_hurt_dest'] = "__unit_id_of_hurt_dest",
    ['damage_value_of_hurt_dest'] = "__damage_value_of_hurt_dest",
    ['ability'] = "__ability",
    ['ability_id'] = "__ability_id",
    ['ability_index'] = "__ability_index",
    ['ability_type'] = "__ability_type",
    ['ability_seq'] = "__ability_seq",
    ['ability_iter'] = "ability_iter",
    ['ability_runtime_id'] = "__ability_runtime_id",
    ['skill_pointer_type'] = "__skill_pointer_type",
    ['attr'] = "__attr",
    ['attr_key'] = "__attr_key",
    ['add_exp'] = "__add_exp",
    ['activation_code_group'] = "__activation_code_group",
    ['cmd_type'] = "__cmd_type",
    ['cnt'] = "__cnt",
    ['use_cnt'] = "__use_cnt",
    ['curr_lv'] = "__curr_lv",
    ['curr_stock'] = "__curr_stock",
    ['damage'] = "__damage",
    ['damage_type'] = "__damage_type",
    ['cured_value'] = "__cured_value",
    ['is_critical_hit'] = "__is_critical_hit",
    ['is_normal_hit'] = "__is_normal_hit",
    ['damage_result_state'] = "__damage_result_state",
    ['delta'] = "__delta",
    ['delta_lv'] = "__delta_lv",
    ['delta_cnt'] = "__delta_cnt",
    ['left'] = "__left",
    ['layer_change_values'] = "__layer_change_values",
    ['msg'] = "__msg",
    ['res_key'] = "__res_key",
    ['res_value'] = "__res_value",
    ['res_type'] = "__res_type",
    ['res_cost'] = "__res_cost",
    ['stack'] = "__stack",
    ['tech_no'] = "__tech_no",
    ['tech_iter'] = "__tech_iter",
    ['total'] = "__total",
    ['icon_id'] = "__icon_id",
    ['is_middle_join'] = "__is_middle_join",
    ['is_forbidden'] = "__is_forbidden",
    ['is_silent'] = "__is_silent",
    ['comp_name'] = "__comp_name",
    ['event_name'] = "__event_name",
    ['ui_event_name'] = "__ui_event_name",
    ['touch_id'] = 'touch_id',
    ['curr_key'] = '__current_key',
    ['team_id'] = '__team_id',
    ['pos'] = '__pos',
    ['tar_x'] = '__tar_x',
    ['tar_y'] = '__tar_y',
    ['point'] = '__point',
    ['int1'] = '__int1',
    ['float1'] = '__float1',
    ['bool1'] = '__bool1',
    ['str1'] = '__str1',
    ['args'] = '__args',
    ['c_param_1'] = '__c_param_1',
    ['c_param_2'] = '__c_param_2',
    ['c_param_3'] = '__c_param_3',
    ['c_param_4'] = '__c_param_4',
    ['c_param_5'] = '__c_param_5',
    ['c_param_dict'] = '__c_param_dict',
    ['pointing_world_pos'] = '__pointing_world_pos',
    ['mouse_wheel'] = '__mouse_wheel',
    ['cur_dynamic_trigger_ins'] = '__cur_dyna_trigger_ins',
    ['is_day_to_night'] = '__is_day_to_night',
    ['random_pool_iter'] = 'random_pool_iter',
    ['iter_int'] = '__iter_int',
    ['iter_index'] = '__iter_index',
    ['iter_road'] = 'iter_road',
    ['poly_area_iter'] = 'poly_area_iter',
    ['trigger_owner'] = 'trigger_owner',
    ['cur_ability'] = '__cur_ability',
    ['cur_unit'] = '__cur_unit',
    ['cur_item'] = '__cur_item',
    ['cur_modifier'] = '__cur_modifier',
    ['cur_projectile'] = '__cur_projectile',
    ['iter_table_item'] = '__ITER_TABLE_ITEM',
    ['jump_word_type'] = '__jump_word_type',
    ['forbid_critical_hit'] = '__forbid_critical_hit',
    ['ui_comp_iter'] = 'ui_comp_iter',
    ['ui_vx_handler'] = '__ui_vx_handler',
    ['ui_prefab_id'] = '__ui_prefab',
    ['ui_prefab_ins'] = '__ui_prefab_ins',
    ['const_arg'] = '__const_arg',
    ['time'] = '__time',
    ['element_id'] = '__element_id',
    ['eca_key'] = 'eca_key',
    ['arg_type'] = 'arg_type',
    ['sub_type'] = 'sub_type',
    ['break'] = 'BREAK',
    ['return'] = 'RETURN',
    ['trigger_type'] = 'trigger_type',
    ['group_id'] = 'group_id',
    ['func_trigger_id'] = 'func_trigger_id',
    ['is_func'] = 'is_func',
}




IterKey = {
    ['ITER_INT'] = "__iter_int",
    ['ITER_INDEX'] = "__iter_index",
    ['ITER_UNIT'] = 'pick_unit_id',
    ['ITER_ITEM'] = 'item_iter',
    ['ITER_ITEM_NO'] = '__iter_item_no',
    ['ITER_ABILITY'] = "ability_iter",
    ['ITER_MODIFIER'] = "modifier_iter",
    ['ITER_PROJECTILE'] = "pick_projectile_id",
    ['ITER_TECH'] = "__tech_iter",
    ['ITER_DEST'] = "destructible_iter",
    ['ITER_SHOP_ITEM'] = "shop_item_iter",
    ['ITER_UI_COMP'] = "ui_comp_iter",
    ['ITER_RECT_AREA'] = "rect_area_iter",
    ['ITER_CIRCLE_AREA'] = "circle_area_iter",
    ['ITER_POLY_AREA'] = "polygon_area_iter",
    ['ITER_POLY_AREA_POINT'] = "poly_area_point_iter",
    ['ITER_ROAD'] = "iter_road",
    ['ITER_RANDOM_POOL'] = "random_pool_iter",
    ['ITER_ROLE'] = "role_iter",
    ['ITER_ROLE_RES'] = "__role_res_key",
    ['ITER_TABLE_ITEM'] = "__ITER_TABLE_ITEM",
}

---@class UnitCategory 单位分类
UnitCategory = {
    ['英雄'] = 1,
    ['建筑'] = 2,
    ['生物'] = 4,
}

PatrolType = {
    ['ONE_WAY'] = 0,
    ['BACK_AND_FORTH'] = 1,
    ['LOOP'] = 2,
}

UnitState = {
    ['ALIVE'] = 'Alive',
    ['DEAD'] = 'Dead',
    ['DISSOLVE'] = 'Dissolve',
}

---@class UnitKeyFloatAttr 单位属性
UnitKeyFloatAttr = {
    --    ['ROTATE_SPEED'] = 'rotate_speed',
    --    ['CANCEL_ALARM_RANGE'] = 'cancel_alarm_range',
    --    ['ALARM_RANGE'] = 'alarm_range',
    --    ['BODY_SIZE'] = 'body_size',
    ['冷却缩减(%)'] = 'cd_reduce',
    ['白天视野'] = 'vision_rng',
    ['最大生命值'] = 'hp_max',
    ['当前生命值'] = 'hp_cur',
    ['生命恢复'] = 'hp_rec',
    ['最大法力值'] = 'mp_max',
    ['当前法力值'] = 'mp_cur',
    ['法力恢复'] = 'mp_rec',
    ['移动速度'] = 'ori_speed',
    ['物理攻击'] = 'attack_phy',
    ['法术攻击'] = 'attack_mag',
    ['物理防御'] = 'defense_phy',
    ['法术防御'] = 'defense_mag',
    ['攻速'] = 'attack_speed',
    ['暴击率(%)'] = 'critical_chance',
    ['暴击伤害(%)'] = 'critical_dmg',
    ['物理穿透'] = 'pene_phy',
    ['法术穿透'] = 'pene_mag',
    ['物理吸血(%)'] = 'vampire_phy',
    ['法术吸血'] = 'vampire_mag',
    ['物理穿透(%)'] = 'pene_phy_ratio',
    ['法术穿透(%)'] = 'pene_mag_ratio',
    ['伤害豁免(%)'] = 'dmg_reduction',
    ['命中率(%)'] = 'hit_rate',
    ['闪避率(%)'] = 'dodge_rate',
    ['所有伤害加成(%)'] = 'extra_dmg',
    ['被治疗效果加成(%)'] = 'healing_effect',
    ['真实视野'] = 'vision_true',
    ['攻击间隔'] = 'attack_interval',
    ['攻击范围'] = 'attack_range',
    --    ['夜晚视野'] = "vision_night",
    --    ['白天扇形视野半径'] = "vision_sector_rng",
    --    ['夜晚扇形视野半径'] = "vision_sector_night",
    --    ['白天扇形视野夹角'] = "vision_sector_angle_day",
    --    ['夜晚扇形视野夹角'] = "vision_sector_angle_night",
}
---@class uKeyAttr 单位属性
uKeyAttr = {
    ['冷却缩减(%)'] = '冷却缩减(%)',
    ['白天视野'] = '白天视野',
    ['最大生命值'] = '最大生命值',
    ['当前生命值'] = '当前生命值',
    ['生命恢复'] = '生命恢复',
    ['最大法力值'] = '最大法力值',
    ['当前法力值'] = '当前法力值',
    ['法力恢复'] = '法力恢复',
    ['移动速度'] = '移动速度',
    ['物理攻击'] = '物理攻击',
    ['法术攻击'] = '法术攻击',
    ['物理防御'] = '物理防御',
    ['法术防御'] = '法术防御',
    ['攻速'] = '攻速',
    ['暴击率(%)'] = '暴击率(%)',
    ['暴击伤害(%)'] = '暴击伤害(%)',
    ['物理穿透'] = '物理穿透',
    ['法术穿透'] = '法术穿透',
    ['物理吸血(%)'] = '物理吸血(%)',
    ['法术吸血'] = '法术吸血',
    ['物理穿透(%)'] = '物理穿透(%)',
    ['法术穿透(%)'] = '法术穿透(%)',
    ['伤害豁免(%)'] = '伤害豁免(%)',
    ['命中率(%)'] = '命中率(%)',
    ['闪避率(%)'] = '闪避率(%)',
    ['所有伤害加成(%)'] = '所有伤害加成(%)',
    ['被治疗效果加成(%)'] = '被治疗效果加成(%)',
    ['真实视野'] = '真实视野',
    ['攻击间隔'] = '攻击间隔',
    ['攻击范围'] = '攻击范围',
}


ModifyType = {
    ['ADD'] = 0,
    ['SUB'] = 1,
    ['SET'] = 2,
}

---@class DMGType 伤害类型
DMGType = {
    ['物理伤害'] = 0,
    ['法术伤害'] = 1,
    ['真实伤害'] = 2,
}

---@class AbilityCategory 技能类型
AbilityCategory = {
    ['普通攻击'] = 1,
    ['普通技能'] = 2,
    ['英雄技能'] = 3,
    ['PASSIVE_ABILITY'] = 0,
}



---@class AbilityIndex 技能槽位
AbilityIndex = {
    ['升级'] = 19,
    ['出售'] = 20,
    ['PASSIVE'] = 0,
    ['MOVE'] = 1,
    ['COMMON_ATK'] = 2,
    ['ABILITY1'] = 3,
    ['ABILITY2'] = 4,
    ['ABILITY3'] = 5,
    ['ABILITY4'] = 6,
    ['ABILITY5'] = 7,
    ['ABILITY6'] = 8,
    ['ABILITY7'] = 9,
    ['ABILITY8'] = 10,
    ['ABILITY9'] = 11,
    ['ABILITY10'] = 12,
    ['ABILITY11'] = 13,
    ['ABILITY12'] = 14,
    ['ABILITY13'] = 15,
    ['ABILITY14'] = 16,
    ['ABILITY15'] = 17,
    ['ABILITY16'] = 18,
}

---@class RoleType 玩家类型
RoleType = {
    ['用户'] = 1,
    ['电脑'] = 2,
    ['简单AI'] = 5,
    ['困难AI'] = 6,
    ['观察者'] = 10,
}

---@class RoleStatus 玩家在线状态
RoleStatus = {
    ['正在游戏'] = 1,
    ['无'] = 2,
    ['掉线'] = 3,
    ['退出'] = 4,
    ['观战'] = 5,
}
---@class AttrType 属性类型
AttrType = {
    ['基础'] = 'ATTR_BASE',
    ['基础加成%'] = 'ATTR_BASE_RATIO',
    ['增益'] = 'ATTR_BONUS',
    ['增益加成%'] = 'ATTR_BONUS_RATIO',
    ['总属性加成%'] = 'ATTR_ALL_RATIO',

}

MovementObstacleProcessType = {
    ['IGNORE_OBSTACLE'] = 1,
    ['NOT_THROUGH'] = 2,
    ['POINT_BEFORE'] = 4,
    ['POINT_BEHIND'] = 8,
    ['POINT_MIDDLE'] = 16,
}

MouseKey = {
    ['左键'] = 0xF0,
    ['右键'] = 0xF1,
    ['MIDDLE'] = 0xF2,
    ['WHEEL_UP'] = 0xF3,
    ['WHEEL_DOWN'] = 0xF4,
}

---@class KeyboardKey
KeyboardKey = {
    ['NONE'] = 0x00,
    ['ESCAPE'] = 0x01,
    ['KEY_1'] = 0x02,
    ['KEY_2'] = 0x03,
    ['KEY_3'] = 0x04,
    ['KEY_4'] = 0x05,
    ['KEY_5'] = 0x06,
    ['KEY_6'] = 0x07,
    ['KEY_7'] = 0x08,
    ['KEY_8'] = 0x09,
    ['KEY_9'] = 0x0A,
    ['KEY_0'] = 0x0B,
    ['MINUS'] = 0x0C,
    ['EQUAL'] = 0x0D,
    ['BACKSPACE'] = 0x0E,
    ['TAB'] = 0x0F,
    ['Q'] = 0x10,
    ['W'] = 0x11,
    ['E'] = 0x12,
    ['R'] = 0x13,
    ['T'] = 0x14,
    ['Y'] = 0x15,
    ['U'] = 0x16,
    ['I'] = 0x17,
    ['O'] = 0x18,
    ['P'] = 0x19,
    ['LBRACKET'] = 0x1A,
    ['RBRACKET'] = 0x1B,
    ['RETURN'] = 0x1C,
    ['LCTRL'] = 0x1D,
    ['A'] = 0x1E,
    ['S'] = 0x1F,
    ['D'] = 0x20,
    ['F'] = 0x21,
    ['G'] = 0x22,
    ['H'] = 0x23,
    ['J'] = 0x24,
    ['K'] = 0x25,
    ['L'] = 0x26,
    ['SEMICOLON'] = 0x27,
    ['APOSTROPHE'] = 0x28,
    ['GRAVE'] = 0x29,
    ['LSHIFT'] = 0x2A,
    ['BACKSLASH'] = 0x2B,
    ['Z'] = 0x2C,
    ['X'] = 0x2D,
    ['C'] = 0x2E,
    ['V'] = 0x2F,
    ['B'] = 0x30,
    ['N'] = 0x31,
    ['M'] = 0x32,
    ['COMMA'] = 0x33,
    ['PERIOD'] = 0x34,
    ['SLASH'] = 0x35,
    ['RSHIFT'] = 0x36,
    ['NUM_STAR'] = 0x37,
    ['LALT'] = 0x38,
    ['SPACE'] = 0x39,
    ['CAPSLOCK'] = 0x3A,
    ['F1'] = 0x3B,
    ['F2'] = 0x3C,
    ['F3'] = 0x3D,
    ['F4'] = 0x3E,
    ['F5'] = 0x3F,
    ['F6'] = 0x40,
    ['F7'] = 0x41,
    ['F8'] = 0x42,
    ['F9'] = 0x43,
    ['F10'] = 0x44,
    ['PAUSE'] = 0x45,
    ['SCROLL_LOCK'] = 0x46,
    ['NUM_7'] = 0x47,
    ['NUM_8'] = 0x48,
    ['NUM_9'] = 0x49,
    ['NUM_MINUS'] = 0x4A,
    ['NUM_4'] = 0x4B,
    ['NUM_5'] = 0x4C,
    ['NUM_6'] = 0x4D,
    ['NUM_ADD'] = 0x4E,
    ['NUM_1'] = 0x4F,
    ['NUM_2'] = 0x50,
    ['NUM_3'] = 0x51,
    ['NUM_0'] = 0x52,
    ['NUM_PERIOD'] = 0x53,
    ['F11'] = 0x57,
    ['F12'] = 0x58,
    ['NUM_ENTER'] = 0x9C,
    ['RCTRL'] = 0x9D,
    ['NUM_COMMA'] = 0xB3,
    ['NUM_SLASH'] = 0xB5,
    ['SYSRQ'] = 0xB7,
    ['R_ALT'] = 0xB8,
    ['NUM_LOCK'] = 0xC5,
    ['HOME'] = 0xC7,
    ['UPARROW'] = 0xC8,
    ['PAGEUP'] = 0xC9,
    ['LEFTARROW'] = 0xCB,
    ['RIGHTARROW'] = 0xCD,
    ['END'] = 0xCF,
    ['DOWNARROW'] = 0xD0,
    ['PAGEDOWN'] = 0xD1,
    ['INSERT'] = 0xD2,
    ['DELETE'] = 0xD3,
    ['LWIN'] = 0xDB,
    ['RWIN'] = 0xDC,
    ['APPS'] = 0xDD,
}

GameResult = {
    ['VICTORY'] = 'victory',
    ['DEFEAT'] = 'defeat',
    ['NEUTRAL'] = 'neutral',
}

---@class AreaAction
AreaAction = {
    ['进入'] = 1,
    ['离开'] = 0,
}

StateAction = {
    ['ADD'] = true,
    ['REM'] = false,
}

OnOff = {
    ['ON'] = true,
    ['OFF'] = false,
}

OnceRecycle = {
    ['ONCE'] = true,
    ['RECYCLE'] = false,
}

SfxVisibleType = {
    ['ALL'] = 1,
    ['SELF'] = 2,
    ['ALLY'] = 3,
    ['ENEMY'] = 4,
}

LinkSfxPointType = {
    ['START'] = 1,
    ['END'] = 2,
}

SfxRotateType = {
    ['FOLLOW_SOCKET'] = 0,
    ['FOLLOW_MODEL'] = 1,
    ['NOT_FOLLOW'] = 2,
}

---@class SlotType
SlotType = {
    ['PKG'] = 0,
    ['BAR'] = 1,
}
---@class ModifierEffectType buff影响类型
ModifierEffectType = {
    ['普通'] = 1,
    ['正面'] = 2,
    ['负面'] = 3,
}

ModifierType = {
    ['NORMAL'] = 1,
    ['HALO'] = 2,
    ['HALO_EFFECT'] = 3,
    ['SHIELD'] = 4,
}

AbilityPointerType = {
    ['NONE'] = 0,
    ['SECTOR'] = 1,
    ['ARROW'] = 2,
    ['DOUBLE_CIRCLE'] = 3,
    ['TARGET'] = 4,
    ['LOCATION'] = 5,
    ['BUILD'] = 6,
    ['VECTOR'] = 7,
}

DialogDebugType = {
    ['ERROR'] = 1,
    ['WARNING'] = 2,
    ['INFO'] = 3,
}

CameraMoveMode = {
    ['ACC'] = 1,
    ['SMOOTH'] = 0,
    ['DEC'] = 2,
}

CameraShakeMode = {
    ['LEFT_RIGHT'] = 1,
    ['UP_DOWN'] = 2,
    ['FORWARD_BACKWARD'] = 4,
    ['LR_UD'] = 3,
    ['LR_FB'] = 5,
    ['UD_FB'] = 6,
    ['LR_UD_FB'] = 7,
}

SignalType = {
    ['WARNING_COMMON'] = 1,
    ['WARNING_YELLOW'] = 2,
    ['WARNING_BLUE'] = 3,
}

---@class GlobalEventType 事件
GlobalEventType = {
    ['游戏初始化'] = "ET_GAME_INIT",
    ['游戏暂停'] = "ET_GAME_PAUSE",
    ['游戏恢复'] = "ET_GAME_RESUME",
    ['GAME_ELAPSE_ONCE'] = "ET_TIMEOUT",
    ['GAME_ELAPSE_REPEAT'] = "ET_REPEAT_TIMEOUT",
    ['BUILD_SUCCESS'] = "ET_ABILITY_BUILD_FINISH",
    ['START_SKILL_POINTER'] = "ET_START_SKILL_POINTER",
    ['STOP_SKILL_POINTER'] = "ET_STOP_SKILL_POINTER",
    ['CUSTOM_EVENT'] = "ET_EVENT_CUSTOM",
    ['UI_EVENT'] = "ET_TRIGGER_COMPONENT_EVENT",
    ['UNIT_ATTR_CHANGE'] = "ET_UNIT_ATTR_CHANGE",
    ['UNIT_START_NAVI'] = "ET_UNIT_START_NAV_EVENT",
    ['UNIT_END_NAVI'] = "ET_UNIT_END_NAV_EVENT",
    ['ITEM_BROKEN'] = "ET_ITEM_BROKEN",
    ['ITEM_SOLD'] = "ET_ITEM_SOLD",
    ['区域进入'] = "ET_AREA_ENTER",
    ['区域离开'] = "ET_AREA_LEAVE",
    ['UNIT_PRECONDITION_MEET'] = "ET_UNIT_PRECONDITION_SUCCEED",
    ['UNIT_PRECONDITION_FAILED'] = "ET_UNIT_PRECONDITION_FAILED",
    ['ITEM_PRECONDITION_MEET'] = "ET_ITEM_PRECONDITION_SUCCEED",
    ['ITEM_PRECONDITION_FAILED'] = "ET_ITEM_PRECONDITION_FAILED",
    ['ABILITY_PRECONDITION_MEET'] = "ET_ABILITY_PRECONDITION_SUCCEED",
    ['ABILITY_PRECONDITION_FAILED'] = "ET_ABILITY_PRECONDITION_FAILED",
    ['TECH_PRECONDITION_MEET'] = "ET_TECH_PRECONDITION_SUCCEED",
    ['TECH_PRECONDITION_FAILED'] = "ET_TECH_PRECONDITION_FAILED",
    ['KEYBOARD_DOWN'] = "ET_KEYBOARD_KEY_DOWN_EVENT",
    ['KEYBOARD_UP'] = "ET_KEYBOARD_KEY_UP_EVENT",
    ['MOUSE_DOWN'] = "ET_MOUSE_KEY_DOWN_EVENT",
    ['MOUSE_UP'] = "ET_MOUSE_KEY_UP_EVENT",
    ['MOUSE_D_CLICK'] = "MOUSE_KEY_DB_CLICK_EVENT",
    ['MOUSE_MOVE'] = "MOUSE_MOVE_EVENT",
    ['MOUSE_WHEEL'] = "ET_MOUSE_WHEEL_EVENT",
    ['MOUSE_DOWN_UNIT'] = "MOUSE_KEY_DOWN_UNIT_EVENT",
    ['MOUSE_UP_UNIT'] = "MOUSE_KEY_UP_UNIT_EVENT",
    ['MOUSE_D_CLICK_UNIT'] = "MOUSE_KEY_DB_CLICK_UNIT_EVENT",
    ['选中单位'] = "ET_SELECT_UNIT",
    ['选中单位组'] = "ET_SELECT_UNIT_GROUP",
    ['SELECT_ITEM'] = "ET_SELECT_ITEM",
    ['D_CLICK_ITEM'] = "ET_DOUBLE_CLICK_ITEM",
    ['SELECT_DEST'] = "ET_SELECT_DEST",
    ['D_CLICK_DEST'] = "ET_DOUBLE_CLICK_DEST",
    ['玩家加入'] = "ET_ROLE_JOIN_BATTLE",
    ['玩家退出'] = "ET_ROLE_ACTIVE_EXIT_GAME_EVENT",
    ['PLAYER_LOSE_CONNECT'] = "ET_ROLE_LOSE_CONNECT",
    ['PLAYER_RESOURCE_CHANGED'] = "ET_ROLE_RESOURCE_CHANGED",
    ['PLAYER_SEND_STRING'] = "ET_ROLE_INPUT_MSG",
    ['PLAYER_SEND_ANY'] = "ET_CHAT_SEND_GM",
    ['PLAYER_UPGRADE_TECH'] = "ET_ROLE_TECH_UPGRADE",
    ['PLAYER_DOWNGRADE_TECH'] = "ET_ROLE_TECH_DOWNGRADE",
    ['PLAYER_CHANGE_TECH'] = "ET_ROLE_TECH_CHANGED",
}

UIEventType = {
    ['UI_CREATE'] = "ET_UI_PREFAB_CREATE_EVENT",
    ['UI_DELETE'] = "ET_UI_PREFAB_DEL_EVENT",
}

---@class UnitEventType 单位事件类型
UnitEventType = {
    ['BEFORE_UNIT_DIE'] = "ET_BEFORE_UNIT_DIE",
    ['单位死亡'] = "ET_UNIT_DIE",
    ['KILL_UNIT'] = "ET_KILL_UNIT",
    ['单位出生'] = "ET_UNIT_BORN",
    ['REVIVE_UNIT'] = "ET_REVIVE_UNIT",
    ['UPGRADE_UNIT'] = "ET_UPGRADE_UNIT",
    ['UNIT_PRE_ADD_EXP'] = "ET_UNIT_PRE_ADD_EXP",
    ['UNIT_ON_ADD_EXP'] = "ET_UNIT_ON_ADD_EXP",
    ['UNIT_BE_HURT'] = "ET_UNIT_BE_HURT",
    ['UNIT_HURT_OTHER'] = "ET_UNIT_HURT_OTHER",
    ['UNIT_BE_HURT_BEFORE_APPLY'] = "ET_UNIT_BE_HURT_BEFORE_APPLY",
    ['UNIT_HURT_OTHER_BEFORE_APPLY'] = "ET_UNIT_HURT_OTHER_BEFORE_APPLY",
    ['造成伤害(结算完成)-任意单位'] = "ET_UNIT_BE_HURT_COMPLETE",
    ['造成伤害(结算完成)-指定单位'] = "ET_UNIT_HURT_OTHER_FINISH",
    ['UNIT_GET_CURE_BEFORE_APPLY'] = "ET_UNIT_GET_CURE_BEFORE_APPLY",
    ['UNIT_GET_CURE_FINISH'] = "ET_UNIT_GET_CURE_FINISH",
    ['UNIT_GET_CURE'] = "ET_UNIT_GET_CURE",
    ['UNIT_RELEASE_ABILITY'] = "ET_UNIT_RELEASE_ABILITY",
    ['UNIT_START_MOVE'] = "ET_UNIT_START_MOVE",
    ['UNIT_ENTER_BATTLE'] = "ET_UNIT_ENTER_BATTLE",
    ['UNIT_EXIT_BATTLE'] = "ET_UNIT_EXIT_BATTLE",
    ['UNIT_ENTER_GRASS'] = "ET_UNIT_ENTER_GRASS",
    ['UNIT_LEAVE_GRASS'] = "ET_UNIT_LEAVE_GRASS",
    ['UNIT_ON_COMMAND'] = "ET_UNIT_ON_COMMAND",
    ['UNIT_ABILITY_UPGRADE'] = "ET_ABILITY_PLUS_POINT",
    ['UNIT_REMOVE'] = "ET_UNIT_REMOVE",
    ['UNIT_SHOP_BUY_UNIT'] = "ET_UNIT_SHOP_BUY_UNIT",
    ['UNIT_SHOP_BUY_ITEM'] = "ET_UNIT_SHOP_BUY_ITEM",
    ['UNIT_ITEM_SELL'] = "ET_UNIT_ITEM_SELL",
    ['UNIT_ITEM_COMPOSE'] = "ET_UNIT_ITEM_COMPOSE",
    ['UNIT_SHOP_BUY_WITH_COMPOSE'] = "ET_UNIT_SHOP_BUY_WITH_COMPOSE",
    ['UNIT_UPGRADE_TECH'] = "ET_UNIT_UPGRADE_TECH",
    ['UNIT_ADD_TECH'] = "ET_UNIT_ADD_TECH",
    ['UNIT_REMOVE_TECH'] = "ET_UNIT_REMOVE_TECH",
    ['UNIT_ROLE_CHANGED'] = "ET_UNIT_ROLE_CHANGED",
}

---@class ItemEventType 物品事件
ItemEventType = {
    ['物品创建'] = "ET_ITEM_ON_CREATE",
    ['物品-单位获得'] = "ET_UNIT_ADD_ITEM",
    ['ITEM_ADD_TO_PKG'] = "ET_UNIT_ADD_ITEM_TO_PKG",
    ['ITEM_ADD_TO_BAR'] = 'ET_UNIT_ADD_ITEM_TO_BAR',
    ['物品-单位失去'] = 'ET_UNIT_REMOVE_ITEM',
    ['ITEM_REMOVE_FROM_PKG'] = 'ET_UNIT_REMOVE_ITEM_FROM_PKG',
    ['ITEM_REMOVE_FROM_BAR'] = 'ET_UNIT_REMOVE_ITEM_FROM_BAR',
    ['ITEM_USE'] = 'ET_UNIT_USE_ITEM',
    ['ITEM_CHANGE_STACK'] = "ET_ITEM_STACK_CHANGED",
    ['ITEM_CHANGE_CHARGE'] = "ET_ITEM_CHARGE_CHANGED",
    ['ITEM_DESTROY'] = "ET_ITEM_ON_DESTROY",
    ['ITEM_CREATE_ON_DEST_COLLECTED'] = "ET_ITEM_CREATE_ON_DEST_COLLECTED",
}

---@class AbilityEventType 技能事件类型
AbilityEventType = {
    ['即将施法'] = "ET_ABILITY_CS_START",
    ['施法开始'] = "ET_ABILITY_PS_START",
    ['施法引导'] = "ET_ABILITY_PS_END",
    ['施法出手'] = "ET_ABILITY_SP_END",
    ['施法完成'] = "ET_ABILITY_CST_END",
    ['后摇结束'] = "ET_ABILITY_BS_END",
    ['ABILITY_PS_INTERRUPT'] = "ET_ABILITY_PS_INTERRUPT",
    ['ABILITY_SP_INTERRUPT'] = "ET_ABILITY_SP_INTERRUPT",
    ['ABILITY_CST_INTERRUPT'] = "ET_ABILITY_CST_INTERRUPT",
    ['施法停止'] = "ET_ABILITY_END",
    ['获得技能'] = "ET_ABILITY_OBTAIN",
    ['失去技能'] = "ET_ABILITY_LOSE",
    ['ABILITY_UPGRADE'] = "ET_ABILITY_PLUS_POINT",
    ['ABILITY_LEVEL_CHANGED'] = "ET_ABILITY_UPGRADE",
    ['ABILITY_CD_END'] = "ET_ABILITY_CD_END",
    ['ABILITY_SWITCH'] = "ET_ABILITY_SWITCH",
}

---@class ModifierEventType 魔法效果事件 
ModifierEventType = {
    ['获得魔法效果'] = "ET_OBTAIN_MODIFIER",
    ['失去魔法效果'] = "ET_LOSS_MODIFIER",
    ['循环触发'] = "ET_MODIFIER_CYCLE_TRIGGER",
    ['层数变化'] = "ET_MODIFIER_LAYER_CHANGE",
    ['MODIFIER_GET_BEFORE_CREATE'] = "ET_MODIFIER_GET_BEFORE_CREATE",
    ['MODIFIER_BE_COVERED'] = "ET_MODIFIER_BE_COVERED",
    ['叠加'] = "ET_MODIFIER_ADDTION",
}

ProjectileEventType = {
    ['PROJECTILE_PRODUCE'] = "ET_PRODUCE_PROJECTILE",
    ['PROJECTILE_END'] = "ET_DEATH_PROJECTILE",
}

PlatformEventType = {
    ['HOLD_STORE_ITEM'] = "ET_ROLE_HOLD_STORE_ITEM",
    ['USE_STORE_ITEM_END'] = "ET_ROLE_USE_STORE_ITEM_END",
}

DestructibleEventType = {
    ['DEST_CREATE'] = "ET_DEST_CREATE_NEW",
    ['DEST_DIE'] = "ET_DEST_DIE_NEW",
    ['DEST_REVIVE'] = "ET_DEST_REVIVE_NEW",
    ['DEST_RES_CNT_CHG'] = "ET_DEST_RES_CNT_CHG_NEW",
    ['DEST_COLLECTED'] = "ET_DEST_COLLECTED_NEW",
    ['DEST_GET_HURT'] = "ET_GET_HURT_NEW",
    ['DEST_DELETE'] = "ET_DEST_DELETE",
}
